# -*- coding: utf-8 -*-

import wx
import wx.grid

class SimpleGrid(wx.grid.Grid):
    def __init__(self, parent, id=-1):
        wx.grid.Grid.__init__(self, parent, id)
        self.CreateGrid(5,2)
        self.SetColLabelValue(0, "A")
        self.SetColLabelValue(1, "B")
        self.SetRowLabelValue(0, "1")
        self.SetCellValue(0,0,"Bob")
        self.SetCellValue(0,1,"Zhang")
        self.SetRowLabelValue(1, "2")
        self.SetCellValue(1,0,"Tom")
        self.SetCellValue(1,1,"Wang")
    
class Frame(wx.Frame):
    def __init__(self, parent, id=-1):
        wx.Frame.__init__(self,parent,id, title="Sample Grid")
#        panel = wx.Panel(self)
        grid = SimpleGrid(self)

class App(wx.App):
    def __init__(self, redirect=False, filename=None):
        wx.App.__init__(self, redirect, filename)
    
    def OnInit(self):
        self.frame = Frame(None)
        self.frame.Show()
        return True
        
if __name__ == '__main__':
#    app = App()
    app = wx.PySimpleApp()
    frame = Frame(None)
    frame.Show()
    app.MainLoop()